import React, {Component} from 'react';

class App extends Component {
    state={
        text:'111'
    }
    render() {
        console.log('render')
        return (
            <div>
                <button onClick={()=>{
                    this.setState({
                        text:'222'
                    })
                }}>click</button>
                app
                <div>{this.state.text}</div>
            </div>
        );
    }

    // componentWillUpdate(nextProps, nextState, nextContext) {
    //     console.log('componentWillUpdate')
    // }

    componentDidUpdate(prevProps, prevState, snapshot) {
        console.log('componentDidUpdate',prevProps,prevState,snapshot)
    }

    getSnapshotBeforeUpdate(prevProps, prevState) {
        console.log('getSnapshotBeforeUpdate')
        return 100
    }
}

export default App;